<!-- Main content -->
<!-- <jumbotrons tag-name="'Post'" tag-type="'1'"></jumbotrons> -->
<section class="" ng-init="getSingle()">
  <form ng-class="{'submitted': submitted}" ng-submit="save()">
    <actions
      preview-url="viewmodel.detailsUrl"
      back-url="referrerUrl"
    ></actions>
    <div class="row">
      <section class="col-sm-8">
        <div class="row">
          <div class="col-lg-12">
            <div class="mb-3">
              <label class="form-label">Title</label>
              <input
                type="text"
                class="form-control form-control-lg"
                ng-model="viewmodel.title"
                ng-blur="$ctrl.generateSEO()"
              />
            </div>
            <div class="mb-3">
              <label class="form-label">Excerpt</label>
              <textarea
                class="form-control form-control-lg"
                ng-model="viewmodel.excerpt"
              >
{{viewmodel.excerpt}}</textarea
              >
            </div>
          </div>
        </div>
        <div class="row">
          <div class="col-lg-12">
            <post-medias
              post="viewmodel"
              medias="viewmodel.mediaNavs"
            ></post-medias>
          </div>
        </div>

        <div class="row">
          <tabs-v class="col-lg-12">
            <pane-v header="General">
              <post-general post="viewmodel"></post-general>
            </pane-v>
            <pane-v header="Seo">
              <post-seo post="viewmodel"></post-seo>
            </pane-v>
            <pane-v header="Parents">
              <post-parents post="viewmodel"></post-parents>
            </pane-v>
            <pane-v header="Modules">
              <post-modules post="viewmodel"></post-modules>
            </pane-v>
            <pane-v header="Layout">
              <div class="tab-pane">
                <template-editor
                  is-readonly="'true'"
                  folder-type="'Posts'"
                  template="viewmodel.view"
                  templates="viewmodel.templates"
                  enable-rename="'true'"
                ></template-editor>
              </div>
            </pane-v>
            <pane-v header="Related">
              <related-navs
                request="request"
                source-id="viewmodel.id"
                culture="viewmodel.specificulture"
                prefix="'post'"
                navs="viewmodel.postNavs"
                data="data"
                load-data="getList(pageIndex)"
              >
              </related-navs>
            </pane-v>
          </tabs-v>
        </div>
      </section>
      <section class="col-sm-4" style="padding-left: 0">
        <cultures
          is-clone="viewmodel.isClone"
          data="viewmodel.cultures"
        ></cultures>
        <div class="card mb-4">
          <h6 class="card-header">Info</h6>
          <div class="card-body">
            <statuses status="viewmodel.status"></statuses>
            <div class="mb-3" ng-if="viewmodel.status == 4">
              <label class="form-label">Published Date Time</label>
              <div class="input-group input-group-sm mb-3">
                <span class="input-group-text" id="basic-addon1"
                  ><i class="mi mi-Calendar"></i
                ></span>
                <input
                  value="{{viewmodel.publishedDateTime}}"
                  ng-model="viewmodel.publishedDateTime"
                  type="datetime-local"
                  class="form-control"
                />
              </div>
            </div>
            <div class="mb-3">
              <label class="form-label">Created Date Time</label>
              <div class="input-group input-group-sm">
                <span class="input-group-text" id="basic-addon1"
                  ><i class="mi mi-Calendar"></i
                ></span>
                <input
                  ng-model="viewmodel.createdDateTime"
                  type="text"
                  class="form-control"
                  readonly="readonly"
                />
              </div>
            </div>
            <div class="mb-3">
              <label class="form-label">Author</label>
              <div class="input-group input-group-sm">
                <span class="input-group-text" id="basic-addon1"
                  ><i class="mi mi-Contact"></i
                ></span>
                <input
                  ng-model="viewmodel.createdBy"
                  class="form-control"
                  readonly="readonly"
                />
              </div>
            </div>
            <div class="mb-3 mb-0">
              <label class="form-label">Template</label>
              <div class="input-group">
                <span class="input-group-text" id="basic-addon1"
                  ><i class="mi mi-Layout"></i
                ></span>
                <select
                  class="form-select"
                  ng-options="item as item.fileName for item in viewmodel.templates track by item.id"
                  ng-model="viewmodel.view"
                ></select>
              </div>
            </div>
          </div>
        </div>
        <modal-nav-metas
          ng-if="viewmodel.sysCategories"
          header="'Categories'"
          parent-id="viewmodel.id"
          is-open="'show'"
          parent-type="'Post'"
          type="''"
          mix-database-name="'sys_category'"
          column-display="'title'"
          selected-list="viewmodel.sysCategories"
        ></modal-nav-metas>
        <modal-nav-metas
          ng-if="viewmodel.sysTags"
          header="'Tags'"
          parent-id="viewmodel.id"
          is-open="'show'"
          parent-type="'Post'"
          type="''"
          mix-database-name="'sys_tag'"
          column-display="'title'"
          selected-list="viewmodel.sysTags"
        ></modal-nav-metas>
        <div class="card mb-4">
          <h6
            class="card-header position-sticky position-sticky-under-actionbar"
          >
            URL Alias
            <button
              class="btn btn-link text-primary btn-sm float-end py-0"
              type="button"
              data-bs-toggle="collapse"
              data-bs-target="#slug-tab"
              aria-controls="slug-tab"
              aria-expanded="false"
              aria-label="Toggle navigation"
            >
              <span class="far fa-minus-square text-primary"></span> Show/Hide
            </button>
            <button
              class="btn btn-link text-primary btn-sm float-end py-0"
              type="button"
              ng-click="addAlias()"
            >
              <span class="fas fa-plus text-primary"></span> Add slugs
            </button>
          </h6>
          <div id="slug-tab" class="card-body collapse-x">
            <url-alias
              ng-repeat="alias in viewmodel.urlAliases"
              ng-if="alias"
              index="$index"
              url-alias="alias"
              remove-callback="removeAliasCallback(index)"
            ></url-alias>
          </div>
        </div>
        <custom-image
          header="'Image'"
          type="'Posts'"
          folder="viewmodel.seoName"
          src-url="viewmodel.imageUrl"
          src="viewmodel.image"
          auto="'true'"
        ></custom-image>
        <custom-image
          header="'Thumnail'"
          type="'Posts'"
          folder="viewmodel.seoName"
          src-url="viewmodel.thumbnailUrl"
          src="viewmodel.thumbnail"
          auto="'true'"
        ></custom-image>
      </section>
    </div>
  </form>
</section>
<!-- /.content -->
